/**
 * 
 *
 * 
 * 
 */
package com.east196.xfast.aop.xfast;

import com.east196.xfast.config.XfastConst;
import com.east196.xfast.engine.XfastExp;
import com.east196.xfast.model.Menu;
import com.east196.xfast.model.MetaObject;
import com.east196.xfast.model.User;
import com.jfinal.core.Controller;

/**
 * Eova全局业务拦截器上下文
 *
 * @author East196
 * @date 2018-8-29
 */
public class XfastContext {

	/**
	 * 当前控制器
	 */
	public Controller ctrl;

	/**
	 * 当前用户对象
	 */
	public User user;

	/**
	 * 当前菜单
	 */
	public Menu menu;

	/**
	 * 当前元对象
	 * 元字段=object.fields
	 * 
	 */
	public MetaObject object;

	/**
	 * 当前操作表达式
	 */
	public XfastExp exp;

	public XfastContext(Controller ctrl) {
		this.ctrl = ctrl;
		this.user = (User) ctrl.getSessionAttr(XfastConst.USER);
	}

	public int UID() {
		return this.user.get("id");
	}
}
